package com.rfid.afd.activity;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.rfid.afd.activity.view.IView;
import com.rfid.afd.presenter.BasePresenter;

public abstract class BaseActivity<T extends BasePresenter>  extends AppCompatActivity {

    protected T mPresenter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mPresenter = getPresenter();
        mPresenter.onAttach(this);
    }



    @Override
    protected void onDestroy() {
        super.onDestroy();
        mPresenter.detach();
    }

    public abstract T getPresenter();
}
